const { Article } = require('../../model/article')
const pagination = require('mongoose-sex-page')
module.exports = async (req, res) => {
    const { page } = req.query;
    // 标识 标识当前访问的是文章管理页面
    req.app.locals.currentLink = 'article';
    // let articles = await Article.find().populate('author');
    let articles = await pagination(Article).find().page(page).size(2).display(3).exec();
    res.render('admin/article.art', {
        articles: articles
    });
}